package priv.yiyuan.example.composite;

/**
 * 权限检查访问者
 * <p>
 * 访问者模式 具体访问者
 *
 * @author YiYuan
 * @data 2025/8/28
 * @apoNote
 */
public class PermissionCheckVisitor implements FileSystemVisitor {

    private String user;

    public PermissionCheckVisitor(String user) {
        this.user = user;
    }

    @Override
    public void visitFile(File visitor) {
        System.out.println("校验文件权限: " + visitor.getName() + " 访问用户: " + user + " - 读写权限");
    }

    @Override
    public void visitFolder(Folder visitor) {
        System.out.println("校验文件夹权限: " + visitor.getName() + " 访问用户: " + user + " - 完全访问权限");
    }

}
